package com.csx.saas.platform.init.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.csx.basic.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 企业版本与服务关系
 * </p>
 *
 * @author ChenSongXin
 * @since 2021-02-24
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("saas_init_version_service")
@ApiModel(value = "InitVersionService", description = "套餐版本与服务关系")
@AllArgsConstructor
public class InitVersionService extends SuperEntity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 服务编号
     */
    @ApiModelProperty(value = "服务编号")
    @Length(max = 20, message = "服务编号长度不能超过20")
    @TableField(value = "service_nbr", condition = LIKE)
    @Excel(name = "服务编号")
    private String serviceNbr;

    /**
     * 版本编号
     */
    @ApiModelProperty(value = "版本编号")
    @Length(max = 20, message = "版本编号长度不能超过20")
    @TableField(value = "version_nbr", condition = LIKE)
    @Excel(name = "版本编号")
    private String versionNbr;


    @Builder
    public InitVersionService(Long id, Long createdBy, LocalDateTime createTime, 
                    String serviceNbr, String versionNbr) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.serviceNbr = serviceNbr;
        this.versionNbr = versionNbr;
    }

}
